package semantic.rules

import semantic.rules.walk._
import semantic.rules.postprocess._
import scala.collection.mutable.ArrayBuffer
import syntax.CCategory

object CRules
{
    val WALK_RULES:collection.Map[CCategory, CWalkRule] = collection.mutable.HashMap(Array(
        CWalkRuleAssign,
        CWalkRuleAddSubMulDiv,
        CWalkRuleNumber,
        CWalkRuleExpression,
        CWalkRuleEqNeqGteGtLteLt,
        CWalkRuleWhile,
        CWalkRuleIdentifier,
        CWalkRuleFunctionDefinition,
        CWalkRuleFunctionCall,
        CWalkRuleTrueFalse,
        CWalkRuleOrAndNot,
        CWalkRuleIfElse) flatMap (r => r.categories.asInstanceOf[Seq[CCategory]] map (nt => nt -> r)):_*)

    val POST_PROCESS_RULES:Seq[CPostProcessRule] = ArrayBuffer(CPostProcessRuleWhile, CPostProcessRuleIfElse, CPostProcessRuleClean)
}
